package net.frankish.tools.toolbar2;
/*
=====================================================================

	TabButton.java

	Created by Claude Duguay
	Copyright (c) 1998

=====================================================================
*/

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Insets;
import java.net.URL;

import javax.swing.ImageIcon;
import javax.swing.JButton;

public class TabButton extends JButton
{
	public TabButton(String name,String displayText, String toolTip, URL icon, Color color)
	{
		super((displayText==null?name:displayText));
		int height = 50;
		setOpaque(true);
		setFocusPainted(false);
		if(icon != null){
			ImageIcon ic = new ImageIcon(icon);
			setIcon(ic);
			height = ic.getIconHeight() + 10;
		}
		if(toolTip!=null)
			setToolTipText(toolTip);
		if(color!=null)
			setBackground(color);
		setMargin(new Insets(1, 10, 1, 10));
		setMinimumSize(new Dimension(50, height));
		setPreferredSize(new Dimension(50, height));
	}

	@Override
	public boolean isFocusTraversable()
	{
		return false;
	}

	@Override
	public boolean isDefaultButton()
	{
		return false;
	}

}
